3.86 \(\int \frac{(a+b x) (A+B x)}{x^2} \, dx\)

Optimal. Leaf size=22 \[ \log (x) (a B+A b)-\frac{a A}{x}+b B x \]

[Out]

-((a*A)/x) + b*B*x + (A*b + a*B)*Log[x]

________________________________________________________________________________________

Rubi [A]  time = 0.0126413, antiderivative size = 22, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 1, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.071, Rules used = {76} \[ \log (x) (a B+A b)-\frac{a A}{x}+b B x \]

Antiderivative was successfully verified.

[In]

Int[((a + b*x)*(A + B*x))/x^2,x]

[Out]

-((a*A)/x) + b*B*x + (A*b + a*B)*Log[x]

Rule 76

Int[((d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_))*((e_) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*
x)*(d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, d, e, f, n}, x] && IGtQ[p, 0] && (NeQ[n, -1] || EqQ[p, 1]) && N
eQ[b*e + a*f, 0] && ( !IntegerQ[n] || LtQ[9*p + 5*n, 0] || GeQ[n + p + 1, 0] || (GeQ[n + p + 2, 0] && Rational
Q[a, b, d, e, f])) && (NeQ[n + p + 3, 0] || EqQ[p, 1])

Rubi steps

\begin{align*} \int \frac{(a+b x) (A+B x)}{x^2} \, dx &=\int \left (b B+\frac{a A}{x^2}+\frac{A b+a B}{x}\right ) \, dx\\ &=-\frac{a A}{x}+b B x+(A b+a B) \log (x)\\ \end{align*}

Mathematica [A]  time = 0.0098639, size = 22, normalized size = 1. \[ \log (x) (a B+A b)-\frac{a A}{x}+b B x \]

Antiderivative was successfully verified.

[In]

Integrate[((a + b*x)*(A + B*x))/x^2,x]

[Out]

-((a*A)/x) + b*B*x + (A*b + a*B)*Log[x]

________________________________________________________________________________________

Maple [A]  time = 0.005, size = 23, normalized size = 1.1 \begin{align*} bBx+A\ln \left ( x \right ) b+B\ln \left ( x \right ) a-{\frac{Aa}{x}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x+a)*(B*x+A)/x^2,x)

[Out]

b*B*x+A*ln(x)*b+B*ln(x)*a-a*A/x

________________________________________________________________________________________

Maxima [A]  time = 1.07353, size = 30, normalized size = 1.36 \begin{align*} B b x +{\left (B a + A b\right )} \log \left (x\right ) - \frac{A a}{x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)*(B*x+A)/x^2,x, algorithm="maxima")

[Out]

B*b*x + (B*a + A*b)*log(x) - A*a/x

________________________________________________________________________________________

Fricas [A]  time = 1.94663, size = 57, normalized size = 2.59 \begin{align*} \frac{B b x^{2} +{\left (B a + A b\right )} x \log \left (x\right ) - A a}{x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)*(B*x+A)/x^2,x, algorithm="fricas")

[Out]

(B*b*x^2 + (B*a + A*b)*x*log(x) - A*a)/x

________________________________________________________________________________________

Sympy [A]  time = 0.344674, size = 19, normalized size = 0.86 \begin{align*} - \frac{A a}{x} + B b x + \left (A b + B a\right ) \log{\left (x \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)*(B*x+A)/x**2,x)

[Out]

-A*a/x + B*b*x + (A*b + B*a)*log(x)

________________________________________________________________________________________

Giac [A]  time = 1.20279, size = 31, normalized size = 1.41 \begin{align*} B b x +{\left (B a + A b\right )} \log \left ({\left | x \right |}\right ) - \frac{A a}{x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)*(B*x+A)/x^2,x, algorithm="giac")

[Out]

B*b*x + (B*a + A*b)*log(abs(x)) - A*a/x